/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: app2022 - T4
 * <p>Powered by webrx On 2022-01-27 11:16:38
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class T4 {
    public static void main(String[] args) {
        System.out.println(Thread.currentThread().getName());
        System.out.println(Thread.currentThread().getPriority());
        // Thread t = new Thread(()->{},"线程名");
        var t = new Thread(() -> {
            System.out.println("Hello World");
        }, "A"); //此处的A也是线程的名称

        //设置线程名称
        t.setName("AAA");
        //java 多线程程序10个级别，10 默认5 最小级别1
        t.setPriority(Thread.MAX_PRIORITY);
        t.start();
        System.out.println(t.getPriority());

        System.out.println(t.getName());

    }
}
